package com.example.conrmaqdemo.ramq;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

/*********************************************************
 * @Author ONE_LLX
 * @Description //TODO 
 * @Date 17:47 2019/11/24
 * @Class Comsumer
 * @Version v1.0
 *********************************************************/
@Component
public class Comsumer {


    @RabbitListener(queues = "rabbit-test1")
    public void process(Message message, Channel channel) throws IOException {
        System.out.println("receive"+new String(message.getBody()));
//        channel.basicAck(message.getMessageProperties().getDeliveryTag(),true);
    }
}
